<ion-header>
  <ion-toolbar>
    <img class="back_img" src="..\assets\img\返回.png" slot="start" (click)="goBack()">
      <ion-title>
          信息
      </ion-title>
      <img class="add_img" src="..\assets\img\添加.png" (click)="addEmail()" slot="end">
  </ion-toolbar>
</ion-header>

<ion-content>
  <!-- 邮件列表-->
  <ion-card >
    <ion-item *ngIf="iskong == true">
          <ion-label>您暂时还没有邮件呢~</ion-label>
    </ion-item>    
    <ion-list *ngFor="let item of emailList" key="item.id" color="warning">
        <ion-item-sliding>
        <!-- <ion-item color="light"> -->
        <ion-item>
            <ion-avatar slot="start">
                <img src="..\assets\img\fileunopen.png" *ngIf="item.isReaded == false">
                <img src="..\assets\img\fileopen.png" *ngIf="item.isReaded == true">
                <!-- <ion-icon name="mail" color="medium" *ngIf="item.isReaded == false"></ion-icon>
                <ion-icon name="mail" *ngIf="item.isReaded == true"></ion-icon> -->
            </ion-avatar>
            <ion-icon name="bookmark" color="danger" *ngIf="item.isImportant == true"></ion-icon>  
            <ion-icon name="bookmark" color="light" *ngIf="item.isImportant == false"></ion-icon>  

            <ion-label (press)="delete(item.id)" (tap)="checkEmail(item.id)"> 
                <!-- 发件人 -->
                <h2>To : {{item.realName}}</h2>
                <!-- 主题 -->
                <h3>{{item.subject}}</h3>
                <h4>{{item.sendTime}}</h4>
                <!-- <h3>{{item.subject}}</h3> -->
                <!-- 内容 -->
                <!-- <p>{{item.body}}</p> -->
            </ion-label>
        </ion-item>
        <ion-item-options side="end">
            <ion-item-option color="success" (click)="checkEmail(item.id)">查看</ion-item-option>
            <ion-item-option color="medium" (click)="delete(item.id)">删除</ion-item-option>
        </ion-item-options>
        </ion-item-sliding>
    </ion-list>

  </ion-card>
</ion-content>